package samsung.yx;

import java.util.Scanner;

public class Recursion {

	static int dp[][][] = new int[25][25][25];
	//static int data[][]=new int[][]{{1,1,1},{2,2,2},{10,4,6},{50,50,50},{-1,7,18},{-1,-1,-1}};

	public static void main(String[] args) {
		Scanner input =new Scanner(System.in);
		int a=0,b=0,c=0;
		while(a>=0||b>=0||c>=0){
			a=input.nextInt();
			b=input.nextInt();
			c=input.nextInt();
			if(a==-1&&b==-1&&c==-1){
				break;
			}
			w(a, b, c);
			System.out.print("w("+a+", "+b+", "+c+") = "+w(a, b, c)+"\n");
	}}

	public static int w(int a, int b, int c) {
		if(a<=0||b<=0||c<=0){
			return 1;
		}
		if (a > 20 || b > 20 || c > 20) {
			return w(20, 20, 20);
		}
		if (dp[a][b][c] >0) {
			return dp[a][b][c];
		}
		if (a < b && b < c) {
			dp[a][b][c] = w(a, b, c - 1) + w(a, b - 1, c - 1) - w(a, b - 1, c);
		} else {
			dp[a][b][c] = w(a - 1, b, c) + w(a - 1, b - 1, c)
					+ w(a - 1, b, c - 1) - w(a - 1, b - 1, c - 1);
		}
		return dp[a][b][c];
	}

}
